<script>
	export default {
		globalData: {
			shopcartList: [],
			dataList: [{
					id: 6,
					imgUrl: "/static/img/product1.jpg",
					name: "温庄贡米",
					pprice: "39.9元",
					oprice: "59.9元",
					desc: "绵糯甘甜 | 米香馥郁",
					numboxValue: 1,
					imgTextDesc: [{
							left: '单位',
							right: '5kg'
						},
						{
							left: '保质期',
							right: '18个月'
						},
						{
							left: '土壤',
							right: '翠竹洋火山富锌硒红壤'
						},
						{
							left: '环境',
							right: '气候温和、光照充足'
						},
					],
					descImgs: [
						'/static/img/cpdf1.jpg',
						'/static/img/cpdf2.jpg',
						'/static/img/cpdf3.jpg',
					]
				},
				{
					id: 5,
					imgUrl: "/static/img/product5.jpg",
					name: "画桥番茄",
					pprice: "4.9元",
					oprice: "17.8元",
					desc: "酸甜可口 | 美味诱人",
					numboxValue: 1,
					imgTextDesc: [{
							left: '单位',
							right: '斤'
						}, {
							left: '品种',
							right: '红农'
						},
						{
							left: '产区',
							right: '明溪县画桥村（近北回归线优势气候带）'
						},
						{
							left: '气候',
							right: '冬无严寒，夏无酷暑'
						}
					],
					descImgs: [
						'/static/img/hqfq1.jpg',
						'/static/img/hqfq2.jpg',
						'/static/img/hqfq3.jpg',
					]
				},
				{
					id: 1,
					imgUrl: "/static/img/product1.jpg",
					name: "常坪豆腐",
					pprice: "1.9元",
					oprice: "9.9元",
					desc: "水润鲜嫩 | 调味百搭",
					numboxValue: 1,
					imgTextDesc: [{
							left: '单位',
							right: '块'
						},
						{
							left: '配料',
							right: '大豆、水、熟石灰'
						},
						{
							left: '贮存条件',
							right: '冷藏'
						}
					],
					descImgs: [
						'/static/img/cpdf1.jpg',
						'/static/img/cpdf2.jpg',
						'/static/img/cpdf3.jpg',
					]
				},
				{
					id: 2,
					imgUrl: "/static/img/product2.jpg",
					name: "林地鸡蛋",
					pprice: "9.9元",
					oprice: "29.9元",
					desc: "天然营养 | 蛋香浓郁",
					numboxValue: 1,
					imgTextDesc: [{
							left: '单位',
							right: '斤'
						}, {
							left: '养殖方式',
							right: '农家散养'
						},
						{
							left: '保质期',
							right: '常温下30天'
						},
						{
							left: '潜在致敏物质',
							right: '鸡蛋'
						},
						{
							left: '注意事项',
							right: '鸡蛋易碎，破损变质请勿食用'
						},
					],
					descImgs: [
						'/static/img/ldjd1.jpg',
						'/static/img/ldjd2.jpg',
						'/static/img/ldjd3.jpg',
					]
				},
				{
					id: 3,
					imgUrl: "/static/img/product3.jpg",
					name: "桂林脐橙",
					pprice: "3.9元",
					oprice: "14.9元",
					desc: "皮薄肉厚 | 汁多味甜",
					numboxValue: 1,
					imgTextDesc: [{
							left: '单位',
							right: '斤'
						}, {
							left: '产品特色',
							right: '农家种植，自然成熟'
						},
						{
							left: '贮存条件',
							right: '常温'
						}
					],
					descImgs: [
						'/static/img/glqc1.jpg',
						'/static/img/glqc2.jpg',
						'/static/img/glqc3.jpg',
					]
				},
				{
					id: 4,
					imgUrl: "/static/img/product4.jpg",
					name: "白叶蜂蜜",
					pprice: "49.9元",
					oprice: "199.9元",
					desc: "天然原蜜 | 甜而不腻",
					numboxValue: 1,
					imgTextDesc: [{
							left: '单位',
							right: '瓶'
						}, {
							left: '规格',
							right: '500g'
						},
						{
							left: '产地',
							right: '明溪县白叶村'
						}
					],
					descImgs: [
						'/static/img/byfm0.jpg',
						'/static/img/byfm1.jpg',
						'/static/img/byfm2.jpg',
						'/static/img/byfm3.jpg',
					]
				},
			],
		},
		onLaunch: function() {
			try {
				const value = uni.getStorageSync('myCachedData');
				if (value) {
					this.globalData.shopcartList = value;
				}
			} catch (e) {
				// error
			}
		},
		onShow: function() {

		},
		onHide: function() {
			try {
				uni.setStorageSync('myCachedData', this.globalData.shopcartList);
				console.log('数据存储成功');
			} catch (e) {
				console.error('数据存储失败', e);
			}
		}
	}
</script>

<style>
	/*每个页面公共css */
	@import './common/uni.css';
	@import './common/common.css';
	@import './common/iconfont.css';
</style>